#include <stdio.h>
#include <math.h>
void move(char x,char y)
{
    printf("%c->%c\n",x,y);
}
void han(int n,char one,char two,char three)
{
   if(n==1)
   {
       move(one,three);
   }
   else
   {
       han(n-1,one,three,two);
       move(one,three);
       han(n-1,two,one,three);
   }
}
int main()
{
    int m;
    printf("number of disks:");
    scanf("%d",&m);
    han(m,'A','B','C');
    return 0;
}
